﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;

namespace MesDock
{
    public partial class messageForm : Form
    {
        public messageForm()
        {
            InitializeComponent();
            this.label1.Text = SelectForm.messageInfo;
        }

        #region 消息提醒窗口，一定时间后自动关闭
        public void ShowMessage(string message,int closeTime)
        {
            this.label1.Text = message;
            this.Width = this.label1.Width+this.label1.Location.X*2;
            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
            timer.Interval = closeTime;
            timer.Tick+=new EventHandler(timer_Tick);
            timer.Start();
        }

        private void timer_Tick(object sender,EventArgs e)
        {
            this.Close();
        }
        #endregion

        private void messageForm_Load(object sender, EventArgs e)
        {

        }
    }
}
